<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common.jsp" %>
<script type="text/javascript" src="${ctx}/static/js/user.js"></script>

<div id="dg_user_toolbar">
    <div style="padding: 10px;">
        <form id="searUserParams">
            <label for="user.uid">ID:</label><input class="easyui-validatebox" type="number" name="user.uid"/>
            <label for="user.name">用户名称:</label><input class="easyui-validatebox" type="text" name="user.name"/>
            <label for="user.sex">性别:</label><select class="easyui-validatebox" type="text" name="user.sex">
                                                      <option>全部</option>
                                                      <option>男</option>
                                                      <option>女</option>
                                                  </select>
            <label for="user.age">年龄:</label><input class="easyui-validatebox" type="text" name="user.age"/>
        </form>
    </div>
    <span onclick="searchUser()" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</span>
    <span onclick="addUser()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</span>
    <span onclick="updateUser()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</span>
    <span onclick="removeUser()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</span>
</div>


<div class="easyui-layout" fit="true">
    <div data-options="region:'center',split:true" title="用户列表" style="width:80%;position: static;">
    <table class="easyui-datagrid" id="dg_user"
           data-options="url:'${ctx}/sys/user_searchPage',fit:true,fitColumns:true,singleSelect:true,pagination:true,pageSize:10,toolbar:'#dg_user_toolbar',onSelect:onSelectDgUser">
        <thead>
        <tr>
            <th data-options="field:'uid',width:100">ID</th>
            <th data-options="field:'name',width:100">用户名称</th>
            <th data-options="field:'sex',width:100">性别</th>
            <th data-options="field:'age',width:100">年龄</th>

        </tr>
        </thead>
    </table>
    </div>

    <script type="text/javascript" src="${ctx}/static/js/userContraint.js"></script>
    <div data-options="region:'east',split:true" title="授权角色" style="width:20%;position: static;">
        <ul id="role_tree_user" class="easyui-tree">

        </ul>
    </div>
</div>


<div id="dl_user_edit" class="easyui-dialog" closed="true" title="编辑菜单" style="width:400px;height:400px; padding: 10px"
     data-options="resizable:true,modal:true,buttons:'#tb_user_edit'">
    <form id="form_user_edit" method="post">
        <div class="mb10">
            <label for=user.uid">ID:</label>
            <input class="easyui-validatebox" type="number" name="user.uid" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label for="user.name">用户名称:</label>
            <input class="easyui-validatebox" type="text" name="user.name" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label for="user.sex">性别:</label>
            <input class="easyui-validatebox" type="text" name="user.sex" data-options=""/>
        </div>
        <div class="mb10">
            <label for="user.age">年龄:</label>
            <input class="easyui-validatebox" type="text" name="user.age" data-options=""/>
        </div>
    </form>
</div>
<div id="tb_user_edit">
    <span onclick="submitUser()" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true">提交</span>
    <span onclick="closeEdit()" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">取消</span>
</div>